package com.shrct.businessprocess.customerservice.events;

import com.shrct.businessprocess.customerservice.RCRoutineServiceInfo;
import com.shrct.businessprocess.customerservice.events.RCRoutineServiceInfoEventsListener;
import edu.fudan.mylang.pf.event.EntityEventsManager;
import java.util.Collection;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("com.shrct.businessprocess.customerservice.events.RCRoutineServiceInfoEventsManager")
public class RCRoutineServiceInfoEventsManager extends EntityEventsManager<RCRoutineServiceInfo> {
  @Autowired(required = false)
  private Collection<RCRoutineServiceInfoEventsListener> listeners = com.google.common.collect.Lists.newArrayList();;
  
  protected Collection<RCRoutineServiceInfoEventsListener> getListeners() {
    return listeners;
  }
  
  public void fireSetAsRequired(final RCRoutineServiceInfo entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCRoutineServiceInfoEventsListener)listener).setAsRequired(entity);
    }
    
  }
  
  public void fireSetAsNotRequired(final RCRoutineServiceInfo entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCRoutineServiceInfoEventsListener)listener).setAsNotRequired(entity);
    }
    
  }
  
  public void fireUpdateInfo(final RCRoutineServiceInfo entity, final Procedure1<? super RCRoutineServiceInfo> preInit) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCRoutineServiceInfoEventsListener)listener).updateInfo(entity,preInit);
    }
    
  }
  
  public void fireSchedule(final RCRoutineServiceInfo entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCRoutineServiceInfoEventsListener)listener).schedule(entity);
    }
    
  }
  
  public void fireCancel(final RCRoutineServiceInfo entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCRoutineServiceInfoEventsListener)listener).cancel(entity);
    }
    
  }
}
